import { FormModel } from '@/model/form';
import Http from '../http';
import { UpdateDataStateInput } from '@/model/public/public';

//新增表单
export const InsertForm = function (form: FormModel) {
  return Http.post('/api/Form/Insert', form)
}

//更新表单
export const UpdateForm = function (form: FormModel) {
  return Http.post('/api/Form/Update', form)
}

 //获取表单
 export const GetAllForm = async function (pageResultModel:any) {
  return await Http.post('/api/Form/GetAllForm',pageResultModel);
}

//根据部门key获取表单
export  const  GetFormByDepId = async function (params: { departmentId?: string}) {
  return await Http.get('/api/Form/GetFormByDepId',params)
}

//根据主键获取表单
export  const  GetFormByFormId = async function (params: { formId: string}) {
  return await Http.get('/api/Form/GetFormByFormId',params)
}

//根据表单主键获取字段
export  const  GetFormField = async function (params: { formId: string}) {
  return await Http.get('/api/Form/GetFormField',params)
}

//更新数据状态
export const UpdateFormDataState = function (input: UpdateDataStateInput) {
  return Http.post('/api/Form/UpdateFormDataState', input)
}